{layout name="layout" /}

<div class="Hui-article">
    <div class="pd-20" style="min-width: 1000px; max-width: 90%;">
        <div class="text-c">
            <form action="" method="GET" id='condition'>
                日期范围：
                <input type="date" id="min_time" name="min_time" class="input-text Wdate" style="width:150px;" {notempty name='min_time'}value="{$min_time}"{/notempty}> -
                <input type="date" id="max_time" name="max_time" class="input-text Wdate" style="width:150px;" {notempty name='max_time'}value="{$max_time}"{/notempty}>
                <label class="btn btn-success radius">
                    置顶:
                    <select name="top" id="">
                        <option value="0">全部</option>
                        {notempty name='top'}
                        <option value="1" {eq name='top' value="1" }selected{/eq}>已置顶</option>
                        <option value="2" {eq name='top' value="2" }selected{/eq}>非置顶</option>
                        {else/}
                        <option value="1">已置顶</option>
                        <option value="2">非置顶</option>
                        {/notempty}
                    </select>
                </label>
                <label class="btn btn-success radius">
                    状态:
                    <select name="status" id="">
                        <option value="0">全部</option>
                        {notempty name='status'}
                        <option value="1" {eq name='status' value="1" }selected{/eq}>正常</option>
                        <option value="2" {eq name='status' value="2" }selected{/eq}>下线</option>
                        {else/}
                        <option value="1">正常</option>
                        <option value="2">下线</option>
                        {/notempty}
                    </select>
                </label>
                <input type="text" name="search" id="" {empty name="search" }placeholder=" 文章名称" {else/}value="{$search}" {/empty} style="width:250px;margin-left: 20px;"
                    class="input-text">
                <button name="" id="" class="btn btn-success" type="submit">
                    <i class="Hui-iconfont">&#xe665;</i> 搜文章</button>
                <a href="{:url('index')}" class="btn btn-danger">
                    <i class="Hui-iconfont">&#xe68f;</i> 清除条件</a>
            </form>
        </div>
        <div class="cl pd-5 bg-1 bk-gray mt-20">
            <span class="l">
                <a href="javascript:;" onclick="del_all()" class="btn btn-danger radius">
                    <i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
                <a href="{:url('add')}" class="btn btn-primary radius">
                    <i class="Hui-iconfont">&#xe600;</i>添加文章</a>
            </span>
        </div>
        <div class="mt-20">
            <table class="table table-border table-bordered table-bg table-hover table-sort">
                <thead>
                    <tr class="text-c">
                        <th width="20px">
                            <input type="checkbox" value="" name="allcheck">
                        </th>
                        <th width="30px">ID</th>
                        <th width="160px">列表缩略图</th>
                        <th width="120px">标题</th>
                        <th width="120px">栏目</th>
                        <th width="160px" colspan="2">状态</th>
                        <th width="60px">排序</th>
                        <th width="60px">点击量</th>
                        <th width="120px">发布日期</th>
                        <th style="min-width: 80px;">操作</th>
                    </tr>
                </thead>
                <tbody>
                    {foreach $data as $val}
                    <tr class="text-c va-m">
                        <td>
                            <input type="checkbox" value="{$val.id}" name="checkbox[]">
                        </td>
                        <td>{$val.id}</td>
                        <td>
                            <img src="{$val.thumb}" style=" width: 150px;">
                        </td>
                        <td class="text-l">
                            <a href="/ensemble/{$val.id}" style="text-decoration:none" title="浏览" target="_blank">{$val.title}</a>
                        </td>
                        <td>
                            {$categories[$val.cid]}
                        </td>
                        <td>{eq name="val.top" value="1"}
                            <a href="javascript:void(0);" title="取消置顶" onClick="top_home('down',this,'top','{$val.id}')" style="text-decoration:none">
                                <span class="label label-success radius">置顶</span>
                            </a>
                            {else/}
                            <a href="javascript:void(0);" title="推荐置顶" onClick="top_home('up',this,'top','{$val.id}')" style="text-decoration:none">
                                <span class="label label-default radius">置顶</span>
                            </a>
                            {/eq}
                        </td>
                        <td>{eq name="val.status" value="1"}
                            <a href="javascript:void(0);" title="下线" onClick="duty('down',this,'{$val.id}')" style="text-decoration:none">
                                <span class="label label-success radius">正常</span>
                            </a>
                            {else/}
                            <a href="javascript:void(0);" title="上线" onClick="duty('up',this,'{$val.id}')" style="text-decoration:none">
                                <span class="label label-default radius">下线</span>
                            </a>{/eq}
                        </td>
                        <td>{$val.sort}</td>
                        <td>{$val.clicks}</td>
                        <td class="text-l">{$val.mtime|date="Y-m-d H:i:s",###}</td>
                        <td class="td-manage">
                            <a href="edit.html?id={$val.id}" title="编辑" style="text-decoration:none" class="ml-10">
                                <i class="Hui-iconfont">&#xe6df;</i>
                            </a>
                            <a href="javascript:;" title="删除" style="text-decoration:none" class="ml-10" onClick="del(this,'{$val.id}')">
                                <i class="Hui-iconfont">&#xe6e2;</i>
                            </a>
                        </td>
                    </tr>
                    {/foreach}
                </tbody>
            </table>
        </div>
        <div class="cl pd-5 bg-1 bk-gray mt-20 ">
            <span class="l">共
                <strong>{$counts}</strong> 篇, {$pages} 页 </span>

            <span class="r">
                {$data->render()}
            </span>
        </div>
    </div>
</div>
<!-- 请在下方写此页面业务相关的脚本 -->
<script type="text/javascript">
</script>
<!--/请在上方写此页面业务相关的脚本-->